#!/usr/bin/env bash
# torque/compute-remote-submit -- Initializes the submission script needed for the job.
#
# This script is somewhat confusing, since it's meant to be run in the submission node.
# Therefore, the environment variables need to be relative to the submission node. For
# example, DEEPDIVE_APP needs to point to the path of the application in the submission
# node.
##
set -euo pipefail

export SSH_HOST
export REMOTE_SH_DIR
export KRB_DIR

JOB_ID=$(sched_submit)
# Save JOB_ID to a file in the working directory in the submission node
echo $JOB_ID > $REMOTE_JOBID_DIR
# Return JOB_ID to caller
echo $JOB_ID
